package com.mes.basicdata.domain;


import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

import org.hibernate.annotations.ForeignKey;

import com.mes.common.domain.BasicModel;



/**
 * <p>
 * 资源，是设备、工人和工具的父类
 * </p>
 * 
 * <p>
 * Created on Apr 7, 2008
 * </p>
 * 
 * @author lhy
 * 
 */
@MappedSuperclass
public class Resource extends BasicModel implements java.io.Serializable {


	@Column(name = "DEPTID", length = 50)
	protected String deptUid;
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="DEPTID", nullable = true,insertable=false,updatable=false)
	protected Dept dept;

	@Transient
	protected String resUid;
	
	@Transient
	protected String resName;

	/**
	 * 是否虚拟
	 */
	@Transient
	protected boolean isVirtual; 
	
	@Transient
	protected Long criticalLevel = 3L;
	
	
	public Long getCriticalLevel() {
		return criticalLevel;
	}

	public void setCriticalLevel(Long criticalLevel) {
		this.criticalLevel = criticalLevel;
	}

	public boolean getIsVirtual() {
		return isVirtual;
	}

	public void setIsVirtual(boolean isVirtual) {
		this.isVirtual = isVirtual;
	}

	public Dept getDept() {
		return dept;
	}

	public String getDeptUid() {
		return deptUid;
	}
	
	public String getResourceUid() {
		return resUid;
	}
	
	public String getName() {
		return resName;
	}

	public void setDeptUid(String deptUid) {
		this.deptUid = deptUid;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}
	
	public void setResourceUid(String resUid) {
		this.resUid = resUid;
	}
	public void setName(String resName) {
		this.resName = resName;
	}

}